import sys

# 列表推导式
vec = [2, 3, 4]
re = [3 * x for x in vec]
print(re)

# 嵌套列表
matrix = [
    [1, 2, 3, 4],
    [5, 6, 7, 8],
    [9, 10, 11, 12]

]
# 3*4矩阵 转为4*3
re2 = [[row[i] for row in matrix] for i in range(4)]
print(re2)
# 集合
basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
print(basket)

# 字典
dic = {1: 11, 2: 22, 3: 33}
print(dic[1])
knights = {'gallahad': 'the pure', 'robin': 'the brave'}
for k, v in knights.items():
    print(k, v)
# 导入模块
print('命令行参数如下:')
for i in sys.argv:
    print(i)
print(sys.path)
